package service.applycheck.impl;

import dao.app.AppRateDao;
import exception.Exceptions;
import model.app.AppRate;
import service.applycheck.AppRateService;

public class AppRateServiceImpl implements AppRateService{
	private AppRateDao appRateDao;

	@Override
	public AppRate getAppRate() {
		return this.appRateDao.findOne("id", 1);
	}

	@Override
	public void save(AppRate appRate) throws Exceptions {
		try {
			this.appRateDao.save(appRate);
		} catch (Exception e) {
			throw new Exceptions("利率信息保存失败！请检查你的利率设定是否正确！");
		}
	}
	
	public AppRateDao getAppRateDao() {
		return appRateDao;
	}

	public void setAppRateDao(AppRateDao appRateDao) {
		this.appRateDao = appRateDao;
	}

}
